import Vue from "vue"
import VueRouter from "vue-router"

const Home = () =>import('../views/home');
const Category = () =>import('../views/Category');
const Me = () =>import('../views/me');
const Profile = () =>import('../views/profile');

//安装插件
Vue.use(VueRouter)

//创建路有对象
const routes= [
  {
    path:'',
    redirect:'/home'
  },
  {
    path: "/home",
    name:"home",
    component:Home
  },
  {
    path: "/shop",
    name: "profile",
    component:Profile
  },
  {
    path: "/me",
    name: "me",
    component:Me
  },
  {
    path: "/category",
    name: "category",
    component:Category
  }
]
const router = new VueRouter({
  routes,
  mode:"history"
})


//导出router
export default router
